package com.learn.spring.async.service;

import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
@Slf4j
@Service
public class AsyncService {

    @Async
    public void asyncMethodWithException() {
        log.info("Async method started");
        // 模拟异常
        throw new RuntimeException("This is a simulated exception");
    }
}

